<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가

if ($g4['https_url']) {
    $outlogin_url = $_GET['url'];
    if ($outlogin_url) {
        if (preg_match("/^\.\.\//", $outlogin_url)) {
            $outlogin_url = urlencode($g4[url]."/".preg_replace("/^\.\.\//", "", $outlogin_url));
        }
        else {
            $purl = parse_url($g4[url]);
            if ($purl[path]) {
                $path = urlencode($purl[path]);
                $urlencode = preg_replace("/".$path."/", "", $urlencode);
            }
            $outlogin_url = $g4[url].$urlencode;
        }
    }
    else {
        $outlogin_url = $g4[url];
    }
}
else {
    $outlogin_url = $urlencode;
}
?>

<script type="text/javascript" src="<?=$g4[path]?>/js/capslock.js"></script>
<script type="text/javascript">
// 엠파스 로긴 참고
var bReset = true;
function chkReset(f)
{
    if (bReset) { if ( f.mb_id.value == '아이디' ) f.mb_id.value = ''; bReset = false; }
    document.getElementById("pw1").style.display = "none";
    document.getElementById("pw2").style.display = "";
}
</script>


<!-- 로그인 전 외부로그인 시작 -->
<form name="fhead" method="post" onsubmit="return fhead_submit(this);" autocomplete="off" style="margin:0px;">
<input type="hidden" name="url" value="<?=$outlogin_url?>">

    <div style="width:270px; float:left; margin-top:10px;">
        <table width="270" border="0" cellpadding="0" cellspacing="0">
        <tr>
        	<td colspan=2><a href="<?=$g4['bbs_path']?>/register.php"><img src="../img/product/bt_join.gif" width="270" height="37" border="0" /></a></td>
        </tr>
        <tr>
            <td height="10">&nbsp;</td>
        </tr>
        <tr>
            <td width="141">
                <table width="141" border="0" cellpadding="0" cellspacing="0">
                <tr>
                    <td width="56" height="20"><img src="../img/product/txt_id.gif" width="31" height="11"></td>
                    <td width="150" height="23" colspan="2" align="center"><input name="mb_id" type="text" class="box6" style="height:20" maxlength="20" required itemname="아이디" value='아이디' onMouseOver='chkReset(this.form);' onFocus='chkReset(this.form);'></td>
                </tr>
                <tr>
                    <td height="20"><img src="../img/product/txt_pass.gif" width="41" height="11"></td>
                    <td id=pw1 width="106" height="23" colspan="2" align="center"><input type="text" class="box6" style="height:20" maxlength="20" required itemname="패스워드" value='패스워드' onMouseOver='chkReset(this.form);' onfocus='chkReset(this.form);'></td>
                    <td id=pw2 style='display:none;' width="106" height="23" colspan="2" align="center"><input name="mb_password" id="outlogin_mb_password" type="password" class="box6" style="height:20" maxlength="20" itemname="패스워드" onMouseOver='chkReset(this.form);' onfocus='chkReset(this.form);' onKeyPress="check_capslock(event, 'outlogin_mb_password');"></td>
                </tr>
                </table>
            </td>
            <td width="64" height="46" rowspan="2" align="center"><input type="image" src="../img/product/bt_login.gif" width="69" height="44"></td>
        </tr>
        </table>
        <div style="clear:both; padding:5px 5px 0 0; text-align:right;">
            <a href="javascript:win_password_lost();"><img src="<?=$outlogin_skin_path?>/img/btn_idfing.gif" border="0"></a>
            <a href="javascript:win_password_lost();"><img src="<?=$outlogin_skin_path?>/img/btn_pwfing.gif"  border="0"></a>
        </div>
    </div>

</form>

<form name="loginFrm" method="get">
<input type="hidden" name="bo_table" value="<?=$bo_table?>">
<input type="hidden" name="bo_gubun">
<input type="hidden" name="param_data">
<input type="hidden" name="param_data2">
</form>

<script type="text/javascript">
function goMySearch(str,param_data,param_data2){
	var f = document.loginFrm;
	if (param_data==null) param_data="";
	if (param_data2==null) param_data2="";
	f.bo_gubun.value = str;
	f.param_data.value = param_data;
	f.param_data2.value = param_data2;
	f.action = "<?=$g4['bbs_path']?>/board_<?=$bo_table?>.php";
	f.submit();
}

function fhead_submit(f)
{
    if (!f.mb_id.value) {
        alert("회원아이디를 입력하십시오.");
        f.mb_id.focus();
        return false;
    }

    if (document.getElementById('pw2').style.display!='none' && !f.mb_password.value) {
        alert("패스워드를 입력하십시오.");
        f.mb_password.focus();
        return false;
    }

    <?
    if ($g4[https_url])
        echo "f.action = '$g4[https_url]/$g4[bbs]/login_check.php';";
    else
        echo "f.action = '$g4[bbs_path]/login_check.php';";
    ?>

    return true;
}
</script>
<!-- 로그인 전 외부로그인 끝 -->
